package com.aaa.java07;

import java.util.Arrays;
import java.util.concurrent.ForkJoinPool;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/8 16:37
 * @description：数组的排序
 * @modified By：
 * @version: 1.0
 */
public class ArraySort {
    public static void main(String[] args) {
        int[] numbers={16,25,9,90,23};
        System.out.println("排序之前");
        for (int number : numbers) {
            System.out.println(number);
        }

       /* for (int i = 1; i < numbers.length; i++) {
            for (int j = 0; j < numbers.length - i; j++) {
                //比较相邻两数的大小，如果大于后者，则交换位置
                if (numbers[j] > numbers[j+1]) {
                    int temp=numbers[j];
                    numbers[j]=numbers[j+1];
                    numbers[j+1]=temp;
                }
            }
        }*/
        Arrays.sort(numbers);
        System.out.println("排序之后");
        for (int number : numbers) {
            System.out.println(number);
        }
    }
}
